﻿import request from '/@/utils/request';
enum Api {
  AddDeiviceTemplateTrigger = '/api/deiviceTemplateTrigger/add',
  DeleteDeiviceTemplateTrigger = '/api/deiviceTemplateTrigger/delete',
  UpdateDeiviceTemplateTrigger = '/api/deiviceTemplateTrigger/update',
  PageDeiviceTemplateTrigger = '/api/deiviceTemplateTrigger/page',
  DetailDeiviceTemplateTrigger = '/api/deiviceTemplateTrigger/detail',
  GetDeviceSlaveTemplatePointsTemplatePointIdDropdown = '/api/deiviceTemplateTrigger/DeviceSlaveTemplatePointsTemplatePointIdDropdown',
  GetDeviceSlaveTemplatePointsControlTemplatePointIdDropdown = '/api/deiviceTemplateTrigger/DeviceSlaveTemplatePointsControlTemplatePointIdDropdown',
  DetailByPointId = '/api/deiviceTemplateTrigger/detailByPointId',
}

// 增加模板预警
export const addDeiviceTemplateTrigger = (params?: any) =>
	request({
		url: Api.AddDeiviceTemplateTrigger,
		method: 'post',
		data: params,
	});

// 删除模板预警
export const deleteDeiviceTemplateTrigger = (params?: any) => 
	request({
			url: Api.DeleteDeiviceTemplateTrigger,
			method: 'post',
			data: params,
		});

// 编辑模板预警
export const updateDeiviceTemplateTrigger = (params?: any) => 
	request({
			url: Api.UpdateDeiviceTemplateTrigger,
			method: 'post',
			data: params,
		});

// 分页查询模板预警
export const pageDeiviceTemplateTrigger = (params?: any) => 
	request({
			url: Api.PageDeiviceTemplateTrigger,
			method: 'post',
			data: params,
		});

// 详情模板预警
export const detailDeiviceTemplateTrigger = (id: any) => 
	request({
			url: Api.DetailDeiviceTemplateTrigger,
			method: 'get',
			data: { id },
		});
// 通过从机变量获取详情模板预警
export const detailByPointId = (id: any) => 
	request({
			url: Api.DetailByPointId,
			method: 'get',
			data: { id },
		});

export const getDeviceSlaveTemplatePointsTemplatePointIdDropdown = () =>
		request({
		url: Api.GetDeviceSlaveTemplatePointsTemplatePointIdDropdown,
		method: 'get'
		});
export const getDeviceSlaveTemplatePointsControlTemplatePointIdDropdown = () =>
		request({
		url: Api.GetDeviceSlaveTemplatePointsControlTemplatePointIdDropdown,
		method: 'get'
		});

